﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="GioHang.aspx.cs" Inherits="WebApplication1.GioHang" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainHolder" runat="server">
<script type="text/javascript">
    function valid(o, w) {
        o.value = o.value.replace(valid.r[w], '');
    }
    valid.r = {
        'numbers': /[^\d]/g
    }
</script>
    <div class="Dock">
        <div style="padding: 2px 0px 2px 10px; font-weight: bold; color: #FFFFFF; float: left; text-align: left" >
            <asp:Label ID="lb_sachtheomenu" runat="server" Text="Giỏ hàng"></asp:Label>
        </div>                
    </div>
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
        <asp:DataList ID="dl_sachmoi" runat="server" CellPadding="10" Font-Bold="False" 
            Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
            Font-Underline="False" HorizontalAlign="Left" 
            Width="719px" RepeatLayout="Flow" GridLines="Horizontal" 
                        onitemcommand="dl_sachmoi_ItemCommand">
            <FooterTemplate>
                <asp:ImageButton ID="ImageButton3" runat="server" 
                    CommandArgument='<%# Eval("mamh") %>' CommandName="submit" Height="26px" 
                    ImageUrl="~/Image/checkout1.gif" Width="106px" />
            </FooterTemplate>
            <HeaderTemplate>
                <table style="width: 100%; color:Red;">
                    <tr>
                        <td align="center" style="width: 249px">
                            Tên</td>
                        <td align="center" style="width: 143px">
                            Số lượng</td>
                        <td align="center" style="width: 141px">
                            Đơn giá</td>
                        <td align="center">
                            Chỉnh sửa</td>
                    </tr>
                </table>
            </HeaderTemplate>
            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left" 
                VerticalAlign="Middle" />
            <ItemTemplate>  
                <table style="width: 100%">
                    <tr>
                        <td style="width: 253px" align="center">
                            <asp:Label ID="lb_tensach" runat="server" Text='<%# Eval("TenMH") %>'></asp:Label>
                        </td>
                        <td align="left" style="width: 100px">
                            <asp:TextBox ID="TextBox2" style=" float: right; text-align: right"  
                                runat="server" Text='<%# Eval("SoLuong") %>' 
                                Width="68px" onkeyup="valid(this,'numbers')" 
                                onblur="valid(this,'numbers')" MaxLength="3"></asp:TextBox>
                        </td>
                        <td align="right" style="width: 124px">
                            <asp:Label ID="lb_dongia" runat="server" 
                                Text='<%# Eval("DonGia","{0:#,##0} VNĐ") %>'></asp:Label>
                        </td>
                        <td align="center" style="width: 49px">
                            &nbsp;</td>
                        <td align="center">
                            <asp:ImageButton ID="ImageButton2" runat="server" 
                                CommandArgument='<%# Eval("MaMH") %>' CommandName="Sua" Height="18px" 
                                ImageUrl="~/Image/configuratin.png" Width="16px" />
                            &nbsp;&nbsp;
                            <asp:ImageButton ID="btn_Huy" runat="server" 
                                CommandArgument='<%# Eval("MaMH") %>' CommandName="Xoa" Height="22px" 
                                ImageUrl="~/Image/Delete-icon.png" Width="20px" />
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList>
                    <br />
                    <br />
                    <asp:Label ID="Label1" runat="server" Text="Tổng thành tiền:"></asp:Label>
                    &nbsp;<asp:Label ID="lb_tongtien" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                    <br />
                    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Xem giỏ hàng cũ hơn</asp:LinkButton>
        </ContentTemplate>
            </asp:UpdatePanel>
    </div>
</asp:Content>
